package org.example.base;

import redis.clients.jedis.Jedis;

import java.util.concurrent.TimeUnit;

public class TestList {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("127.0.0.1", 6379);
//        jedis.lpush("myList","one","tow","three","four");
//        System.out.println("xxx:"+jedis.lrem("myList",1,"one"));
//        System.out.println(jedis.lpush("myList","shabi"));
//        System.out.println(jedis.lpop("myList"));
//        System.out.println(jedis.rpop("myList"));
//        System.out.println(jedis.lindex("myList",2));
        System.out.println(jedis.exists("tow"));
        System.out.println(jedis.lrem("myList",0,"tow"));
        System.out.println("xxx:"+jedis.lrange("myList",0,-1));
        System.out.println(jedis.lset("myList",3,"hjj"));
        System.out.println(jedis.llen("myList"));
        System.out.println(jedis.rpoplpush("myList","otherList"));
        System.out.println("xxx:"+jedis.lrange("otherList",0,-1));

    }
}
